using System;
using System.Collections.Generic;
using System.Windows.Forms;
using System.Threading;
using System.Diagnostics;

namespace RMD.quickswitch
{
    static class Program
    {
        static Mutex g_mutex = null;

        public static Mutex GetAppMutex()
        {
            return g_mutex;
        }

        /// <summary>
        /// The main entry point for the application.
        /// </summary>
        [STAThread]
        static void Main()
        {
            bool ok;
            g_mutex = new Mutex(true, "RMD.quickswitch", out ok);
            if (!ok)
            {                
                g_mutex.Close();
                return;
            }

            GC.KeepAlive(g_mutex);
            Application.EnableVisualStyles();
            Application.SetCompatibleTextRenderingDefault(false);
            Application.Run(new MainForm());
            g_mutex.Close();
        }
    }
}